Skip to content

Conversation

not-matthias
Copy link
Member

@not-matthias not-matthias commented Sep 29, 2025

Fixed some unrelated bugs that I discovered while working on this:

Other changes:

  • Added an example to ensure we handle ResetTimer
  • Add benchmark marker support (had to disable pausing the timer in b.Loop() due to the extra overhead)

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds CodSpeed Go performance v2 support by integrating benchmark timing markers and updating the underlying instrument-hooks dependency.

  • Adds new benchmark timing functionality using start/end timestamps to track performance measurements
  • Updates the instrument-hooks commit to a newer version that supports the v2 performance API
  • Introduces new marker types and timing functions for enhanced benchmark instrumentation

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
testing/testing/benchmark.go Adds startTimestamp field and integrates benchmark timing markers in StartTimer/StopTimer methods
testing/capi/vendor.sh Updates instrument-hooks commit hash to newer version with v2 support
testing/capi/instrument-hooks/includes/core.h Adds new marker type constants and function declarations for timestamp handling
testing/capi/instrument-hooks.go Implements Go bindings for new timestamp and marker functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@not-matthias not-matthias force-pushed the cod-1378-codspeed-go-add-perf-v2-support branch from 7685745 to b3beed3 Compare September 29, 2025 17:36
Copy link

avalanche-staging bot commented Oct 2, 2025

CodSpeed Performance Report

Merging #18 will not alter performance

Comparing cod-1378-codspeed-go-add-perf-v2-support (8ee14f6) with main (d7de44a)

Summary

✅ 8 untouched
🆕 16 new
⏩ 14 skipped1

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 BenchmarkLargeSetup N/A 9.8 ms N/A
🆕 BenchmarkLargeSetupInLoop N/A 24 ns N/A
🆕 BenchmarkSleep100ns N/A 233 ns N/A
🆕 BenchmarkSleep100ns_Loop N/A 240 ns N/A
🆕 BenchmarkSleep100us N/A 100.2 µs N/A
🆕 BenchmarkSleep100us_Loop N/A 100.2 µs N/A
🆕 BenchmarkSleep10ms N/A 10 ms N/A
🆕 BenchmarkSleep10ms_Loop N/A 10 ms N/A
🆕 BenchmarkSleep10us N/A 10.2 µs N/A
🆕 BenchmarkSleep10us_Loop N/A 10.2 µs N/A
🆕 BenchmarkSleep1ms N/A 1 ms N/A
🆕 BenchmarkSleep1ms_Loop N/A 1 ms N/A
🆕 BenchmarkSleep1us N/A 1.2 µs N/A
🆕 BenchmarkSleep1us_Loop N/A 1.2 µs N/A
🆕 BenchmarkSleep50ms N/A 50 ms N/A
🆕 BenchmarkSleep50ms_Loop N/A 50 ms N/A

Footnotes

  1. 14 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@avalanche-staging avalanche-staging bot deleted a comment from codspeed-hq bot Oct 2, 2025
@not-matthias not-matthias force-pushed the cod-1378-codspeed-go-add-perf-v2-support branch from 541b758 to 10f3008 Compare October 2, 2025 16:22
@not-matthias not-matthias force-pushed the cod-1378-codspeed-go-add-perf-v2-support branch from 10f3008 to 574f624 Compare October 2, 2025 16:46
@not-matthias not-matthias requested a review from Copilot October 2, 2025 16:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@not-matthias not-matthias force-pushed the cod-1378-codspeed-go-add-perf-v2-support branch 2 times, most recently from 546ac8a to d405bf5 Compare October 2, 2025 16:55
@not-matthias not-matthias requested a review from art049 October 3, 2025 08:27
@not-matthias not-matthias force-pushed the cod-1378-codspeed-go-add-perf-v2-support branch from f5d2d6f to c19b2fb Compare October 3, 2025 12:13
@not-matthias not-matthias force-pushed the cod-1378-codspeed-go-add-perf-v2-support branch 2 times, most recently from 416dc8a to 7cd5115 Compare October 3, 2025 13:43
@avalanche-staging avalanche-staging bot deleted a comment from codspeed-hq bot Oct 3, 2025
@not-matthias not-matthias force-pushed the cod-1378-codspeed-go-add-perf-v2-support branch from cc154a3 to 7cd5115 Compare October 3, 2025 14:59
@not-matthias not-matthias force-pushed the cod-1378-codspeed-go-add-perf-v2-support branch from 7cd5115 to 8ee14f6 Compare October 3, 2025 17:22
@art049
Copy link
Member

art049 commented Oct 6, 2025

@not-matthias don't forget to archive the removed benchmarks since you changed the folder

Copy link
Member

@art049 art049 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +15 to +20
const (
MarkerTypeSampleStart = 0
MarkerTypeSampleEnd = 1
MarkerTypeBenchmarkStart = 2
MarkerTypeBenchmarkEnd = 3
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same feedback as in the Python PR, if there is a way to avoid duplicating this, it would be great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants